/*
 * Created on 2005-3-11
 */
package com.hd123.rumba.sql;

import java.util.HashMap;

import com.hd123.rumba.util.ObjectUtil;

/**
 * @author caili
 */
public class JdbcRow extends HashMap {
  
  private static final long serialVersionUID = 300100L;
  private Object object;

  public JdbcRow() {
    super();
  }

  public JdbcRow(Object object) {
    super();
    // this.putAll(ObjectUtil.getFields(object, true));
    this.object = object;
  }

  public Object put(String key, Object value) {
    return super.put(key.toUpperCase(), value);
  }

  public Object get(String key) throws Exception {
    if (object == null)
      return super.get(key.toUpperCase());
    else {
      return ObjectUtil.getFieldValue(object, key);
    }
  }
}
